package com.gomore.opple.module.main.good;

import com.gomore.opple.BasePresenter;
import com.gomore.opple.BaseView;
import com.gomore.opple.model.Filter;
import com.gomore.opple.model.QueryFilter;
import com.gomore.opple.rest.goods.GoodsCondition;
import com.gomore.opple.rest.shopcart.SaveShoppingCartRequest;
import com.gomore.opple.web.cgform.consumer.entity.TOConsumerEntity;
import com.gomore.opple.web.cgform.goods.entity.TOGoodsEntity;

import java.util.List;

/**
 * Created by asus on 2016/12/27.
 */
public interface GoodContract {

    interface View extends BaseView<Presenter> {
        /**
         * 显示进度条
         */
        void showProgressDialog();

        /**
         * 隐藏进度条
         */
        void hideProgressDialog();

        /**
         * 展示消息
         *
         * @param msg 消息
         */
        void showMessage(String msg);

        /**
         * 展示消息
         *
         * @param msgId 消息id
         */
        void showMessage(int msgId);

        /**
         * 加载完毕
         */
        void showLoadMoreCompleted();

        /**
         * 刷新完毕
         */
        void showRefreshCompleted();

        /**
         * 展示类容
         */
        void showContent();

        /**
         * 进入商品详情页
         */
        void goGoodDetail(String goodUuid);


    }

    interface Presenter extends BasePresenter {
        /**
         * 准备初始化数据
         */
        void prepareInitData();

        /**
         * 添加到购物车
         *
         * @param saveShoppingCartRequest
         */
        void addToShoppingCar(SaveShoppingCartRequest saveShoppingCartRequest);

        /**
         * 查询商品
         */
        void queryGoods(QueryFilter queryFilter, final boolean loadMore, boolean isFirst);

        /**
         * 获取所有商品查询条件
         */
        void getGoodsFilter();

        /**
         * 获取本地数据
         *
         * @return
         */
        List<TOGoodsEntity> getData();

        /**
         * 获取筛选
         *
         * @return
         */
        List<Filter> getFilter();

        /**
         * 获取客户
         *
         * @return
         */
        TOConsumerEntity getConsumer();

        /**
         * 通过二维码获取商品
         */
        void getGoodByBarCode(String barCode);
    }
}
